﻿namespace GoodAdmin.System;

/// <summary>
/// 用户服务
/// </summary>
public interface ISysUserService
{   /// <summary>
    /// 根据ID获取用户信息
    /// </summary>
    /// <param name="userId">用户id</param>
    /// <returns></returns>
    Task<SysUser> GetUserById(long userId);


    /// <summary>
    /// 登陆时根据用户名获取用户基本信息
    /// </summary>
    /// <param name="Account"></param>
    /// <returns></returns>
    Task<SysUser> GetUserByAccount(string Account);

    /// <summary>
    /// 分页获取用户基本信息
    /// </summary>
    /// <param name="input">分页查询条件</param>
    /// <returns></returns>
    Task<SqlSugarPagedList<SysUser>> GetUserPage(UserPageInput input);


    /// <summary>
    /// 添加用户
    /// </summary>
    /// <param name="userInput"></param>
    /// <returns></returns>
    Task AddUser(UserAddInput userInput);

    /// <summary>
    /// 更新用户信息
    /// </summary>
    /// <param name="userInput"></param>
    /// <returns></returns>
    Task UpdateUser(UserUpdateInput userInput);

    /// <summary>
    /// 删除用户
    /// </summary>
    /// <param name="input">用户Id列表</param>
    /// <returns></returns>
    Task DeleteUser(List<BaseIdInput> input);

    /// <summary>
    /// 根据Id禁用用户
    /// </summary>
    /// <param name="input">用户id</param>
    /// <returns></returns>
    Task<bool> DisableUser(BaseIdInput input);

    /// <summary>
    /// 根据Id启用用户
    /// </summary>
    /// <param name="input">用户id</param>
    /// <returns></returns>
    Task<bool> EnableUser(BaseIdInput input);

    /// <summary>
    /// 根据Id重置用户密码
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task ResetPassword(BaseIdInput input);

    /// <summary>
    /// 修改密码
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task ChangePassword(ChangePwdInput input);

    /// <summary>
    /// 根据用户id获取用户角色列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<List<RoleSelectorOutput>> GetUserRoleList(BaseIdInput input);

    /// <summary>
    /// 用户授权角色
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task GrantUserRole(UserRoleInput input);

    /// <summary>
    /// 获取登录用户菜单列表
    /// </summary>
    /// <returns></returns>
    Task<List<MenuOutPut>> GetLoginUserMenu();

    /// <summary>
    /// 获取登录用户信息
    /// </summary>
    /// <returns></returns>
    Task<UserOutput> GetLoginUserDetail();

    /// <summary>
    /// 根据Id获取用户信息列表
    /// </summary>
    /// <param name="UserIdList"></param>
    /// <returns></returns>
    Task<List<UserSimpleOutput>> GetUserList(List<long> UserIdList);

    /// <summary>
    /// 批量导入模板下载
    /// </summary>
    /// <returns></returns>
    FileStreamResult TemplateDownload();

    /// <summary>
    /// 批量添加用户
    /// </summary>
    /// <param name="file"></param>
    /// <returns></returns>
    Task<ExcelImportResult> BatchAddUser(IFormFile file);

    Task<FileStreamResult> ErrorDownload(BaseIdInput input);
}
